Mercurial > irccd
comparison extern/vera/src/CMakeLists.txt @ 548:a7c0eb100760
CMake: import vera++ 1.3.0, closes #729
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 22 Nov 2017 20:10:03 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
547:a95954e53589 | 548:a7c0eb100760 |
---|---|
1 find_package(TCL) # REQUIRED) | |
2 # don't use find_package's REQUIRED parameter to avoid requiring tk | |
3 if(NOT TCL_FOUND) | |
4 message(FATAL_ERROR "TCL was not found.") | |
5 endif() | |
6 include_directories(SYSTEM ${TCL_INCLUDE_PATH}) | |
7 link_directories(${TCL_LIBRARY_DIRS}) | |
8 | |
9 set(boostLibs filesystem system program_options regex wave) | |
10 | |
11 if(WIN32) | |
12 # use boost static libs to avoid LNK2019 errors | |
13 # feel free to contribute a better fix! | |
14 set(Boost_USE_STATIC_LIBS ON) | |
15 else() | |
16 # expose the Boost_USE_STATIC_LIBS option to ease the manual creation of | |
17 # packages with cpack | |
18 option(Boost_USE_STATIC_LIBS "Use Boost static libraries" OFF) | |
19 endif() | |
20 find_package(Boost COMPONENTS ${boostLibs} REQUIRED) | |
21 include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) | |
22 link_directories(${Boost_LIBRARY_DIRS}) | |
23 # hide Boost_DIR option that doesn't seem to be set by FindBoost | |
24 mark_as_advanced(Boost_DIR) | |
25 # no target | |
26 set(Boost_TARGET) | |
27 | |
28 if(MSVC) | |
29 # hide the warning generated by the usage of getenv() | |
30 add_definitions(-D_CRT_SECURE_NO_WARNINGS) | |
31 add_definitions(-D_SCL_SECURE_NO_WARNINGS) | |
32 endif(MSVC) | |
33 | |
34 configure_file(config.h.in config.h @ONLY) | |
35 include_directories(${CMAKE_CURRENT_BINARY_DIR}) | |
36 | |
37 file(GLOB_RECURSE srcs *.cpp) | |
38 add_executable(vera ${srcs}) | |
39 set_target_properties(vera PROPERTIES OUTPUT_NAME vera++) | |
40 target_link_libraries(vera | |
41 ${TCL_LIBRARY} | |
42 ${Boost_LIBRARIES}) | |
43 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") | |
44 # keep it at the end to be able to build on ubuntu | |
45 target_link_libraries(vera dl) | |
46 endif() |