diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d77ce4..df7477a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,18 +26,23 @@ conan_basic_setup() file(GLOB_RECURSE CORE_SRC_FILES "src/*.cpp" "src/*.hpp") add_library(pkmnLib SHARED ${CORE_SRC_FILES}) -if (NOT DEFINED CONAN_EXPORTED) - # Create Test executable - file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp") - add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp) -endif () foreach (_variableName ${CONAN_LIBS}) message(STATUS "Lib: ${_variableName}") endforeach() target_link_libraries(pkmnLib ${CONAN_LIBS}) -target_link_libraries(pkmnLibTests pkmnLib ${CONAN_LIBS}) + +if (NOT DEFINED CONAN_EXPORTED) + # Create Test executable + file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp") + add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp) + target_link_libraries(pkmnLibTests ${CONAN_LIBS} pkmnLib) + + # Add a definition for the test library + target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD) +endif () + if (WINDOWS) message(STATUS "Using Windows build.") @@ -47,8 +52,6 @@ if (WINDOWS) target_link_libraries(pkmnLibTests -static -static-libgcc -static-libstdc++) endif (WINDOWS) -# Add a definition for the test library -target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)