Gen7Tests/CMakeLists.txt

46 lines
1.5 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.13)
# Make warnings trigger errors.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
project(Gen7Tests)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.")
string(REPLACE "." ";" VERSION_LIST "${CMAKE_C_COMPILER_VERSION}")
list(GET VERSION_LIST 0 VERSION)
list(GET VERSION_LIST 1 MINOR)
if (NOT MINOR MATCHES 0)
SET(VERSION ${VERSION}.${MINOR})
endif()
if (NOT WINDOWS)
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build missing
-s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s build_type=Debug)
else()
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build missing
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows)
endif()
endif ()
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
message(STATUS "Using Conan Libs:")
foreach (_conanLib ${CONAN_LIBS})
message(STATUS "\t ${_conanLib}")
endforeach()
SET(FILE_SOURCE
"src/*.cpp"
"src/*.hpp"
)
file(GLOB_RECURSE CORE_SRC_FILES ${FILE_SOURCE})
add_executable(Gen7Tests ${CORE_SRC_FILES})
SET(_LINKS CreatureLibCore CreatureLibLibrary CreatureLibBattling pkmnLib)
target_link_libraries(Gen7Tests PUBLIC ${_LINKS})