genetic-images/CMakeLists.txt

54 lines
1.5 KiB
CMake
Raw Permalink Normal View History

2019-03-26 16:07:08 +01:00
cmake_minimum_required(VERSION 3.10)
2019-03-19 10:14:19 +01:00
2019-03-19 11:01:39 +01:00
project("GeneticImages"
2019-03-27 15:24:45 +01:00
VERSION 0.1
DESCRIPTION "Recreate reference images with genetic algorithms"
HOMEPAGE_URL "https://labs.phundrak.fr/phundrak/genetic-images"
LANGUAGES CXX)
2019-03-19 10:14:19 +01:00
2019-04-01 16:55:41 +02:00
set(CMAKE_CXX_COMPILER /usr/bin/clang++)
2019-03-19 11:01:39 +01:00
file(GLOB SRC_FILES "src/*.cc")
2019-03-19 10:14:19 +01:00
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(functions)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
enable_cxx_compiler_flag_if_supported("-Wall")
2019-04-01 16:55:41 +02:00
enable_cxx_compiler_flag_if_supported("-Wextra")
enable_cxx_compiler_flag_if_supported("-Wshadow")
enable_cxx_compiler_flag_if_supported("-Wpedantic")
2019-03-19 10:14:19 +01:00
enable_cxx_compiler_flag_if_supported("-pedantic")
2019-04-01 16:55:41 +02:00
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
2019-05-16 23:47:10 +02:00
enable_cxx_compiler_flag_if_supported("-O0")
2019-04-01 16:55:41 +02:00
enable_cxx_compiler_flag_if_supported("-g")
enable_cxx_compiler_flag_if_supported("-pg")
enable_cxx_compiler_flag_if_supported("-finstrument-functions")
2019-04-01 16:55:41 +02:00
else()
enable_cxx_compiler_flag_if_supported("-O3")
enable_cxx_compiler_flag_if_supported("-flto")
endif()
2019-03-19 10:14:19 +01:00
# include_directories(<PUBLIC HEADER DIRECTORIES>)
2019-03-27 15:24:45 +01:00
# Main software
2019-03-19 11:01:39 +01:00
set(TGT genetic-image)
add_executable(${TGT} ${SRC_FILES})
target_compile_features(${TGT} PRIVATE cxx_std_17)
target_include_directories(${TGT} PRIVATE include/genimg)
2019-03-20 12:34:46 +01:00
target_link_libraries(${TGT} ${CONAN_LIBS} stdc++fs)
2019-03-27 15:24:45 +01:00
2019-03-19 10:14:19 +01:00
# OS specific instructions.
if(APPLE)
elseif(WIN32)
2019-03-27 15:24:45 +01:00
# Windows developer environment specific instructions.
if(MINGW)
elseif(MSYS)
elseif(CYGWIN)
endif()
2019-03-19 10:14:19 +01:00
elseif(UNIX)
else()
endif()