diff --git a/CMakeLists.txt b/CMakeLists.txt index 73e9c9cb..f4948a1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,11 @@ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wcast-align -Winfinite-recursion -Wnon-virtu set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG") + +# Configure SFML +set(SFML_SRC_DIR third_party/SFML) +set(SFML_BUILD_DIR sfml_build) +add_subdirectory(${SFML_SRC_DIR} ${SFML_BUILD_DIR}) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") # Place all executables in the executable directory @@ -35,10 +40,6 @@ file(COPY ./assets DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) # Build the main application executables, if requested if(${BUILD_MAIN}) - # Configure SFML - set(SFML_SRC_DIR third_party/SFML) - set(SFML_BUILD_DIR sfml_build) - add_subdirectory(${SFML_SRC_DIR} ${SFML_BUILD_DIR}) # Find all the main files for the various applications # Currently this means any *.cpp file in the root of source diff --git a/tests/unit/core/Loopback.cmake b/tests/unit/core/Loopback.cmake index 721d15e1..5750fe60 100644 --- a/tests/unit/core/Loopback.cmake +++ b/tests/unit/core/Loopback.cmake @@ -6,3 +6,7 @@ target_link_libraries(${EXE_NAME} PRIVATE sfml-network ) +target_include_directories(${EXE_NAME} + PRIVATE ${CMAKE_SOURCE_DIR}/third_party/SFML/include +) +