generated from SFML/cmake-sfml-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from MonashDeepNeuron/cmake_sfml_link_fix
Change project name in CMakeLists
- Loading branch information
Showing
3 changed files
with
20 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(CMakeSFMLProject LANGUAGES CXX) | ||
cmake_minimum_required(VERSION 3.16) | ||
project(fluid LANGUAGES CXX) | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare(SFML | ||
GIT_REPOSITORY https://github.com/SFML/SFML.git | ||
GIT_TAG 2.6.x) | ||
FetchContent_MakeAvailable(SFML) | ||
GIT_TAG 2.6.x) | ||
FetchContent_GetProperties(SFML) | ||
|
||
if(NOT sfml_POPULATED) | ||
FetchContent_Populate(SFML) | ||
add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR}) | ||
endif() | ||
|
||
# add_library(lib OBJECT src/matrix_change.cpp) | ||
# target_link_libraries(lib PRIVATE sfml-graphics) | ||
|
||
add_executable(CMakeSFMLProject src/main.cpp) | ||
target_include_directories(CMakeSFMLProject PRIVATE headers) | ||
target_link_libraries(CMakeSFMLProject PRIVATE sfml-graphics) | ||
target_compile_features(CMakeSFMLProject PRIVATE cxx_std_23) | ||
add_executable(fluid src/main.cpp) | ||
target_include_directories(fluid PRIVATE headers) | ||
target_link_libraries(fluid PRIVATE sfml-graphics sfml-audio) | ||
target_compile_features(fluid PRIVATE cxx_std_23) | ||
|
||
if(WIN32) | ||
add_custom_command( | ||
TARGET CMakeSFMLProject | ||
TARGET fluid | ||
COMMENT "Copy OpenAL DLL" | ||
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,x64,x86>/openal32.dll $<TARGET_FILE_DIR:CMakeSFMLProject> | ||
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,x64,x86>/openal32.dll $<TARGET_FILE_DIR:fluid> | ||
VERBATIM) | ||
endif() | ||
|
||
install(TARGETS CMakeSFMLProject) | ||
install(TARGETS fluid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#pragma once | ||
|
||
constexpr int N = 50; | ||
constexpr int N = 100; | ||
constexpr int SIZE = (N + 2) * (N + 2); | ||
constexpr int CELL_SIZE = 15; | ||
constexpr int CELL_SIZE = 5; | ||
|
||
#define IX(i, j) (i + (N + 2) * j) | ||
#define SWAP(arr1, arr2) std::swap(arr1, arr2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters