1- cmake_minimum_required (VERSION 3.0 )
1+ cmake_minimum_required (VERSION 3.8 )
22
3- project (function_ref)
3+ project (tl- function_ref VERSION 1.0.0 LANGUAGES CXX )
44
5- # Prepare "Catch" library for other executables
6- set (CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR} /test )
7- add_library (Catch INTERFACE )
8- target_include_directories (Catch INTERFACE ${CATCH_INCLUDE_DIR} )
9-
10- # Make test executable
11- set (TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR} /tests/main.cpp
12- ${CMAKE_CURRENT_SOURCE_DIR} /tests/constructors.cpp
13- ${CMAKE_CURRENT_SOURCE_DIR} /tests/call.cpp
14- ${CMAKE_CURRENT_SOURCE_DIR} /tests/issues.cpp
15- ${CMAKE_CURRENT_SOURCE_DIR} /tests/assignment.cpp)
16-
17- add_executable (tests ${TEST_SOURCES} )
5+ option (FUNCTION_REF_ENABLE_TESTS "Enable tests." ON )
186
19- add_library (function_ref INTERFACE )
20- target_sources (function_ref INTERFACE ${CMAKE_SOURCE_DIR} /function_ref.hpp)
21- target_include_directories (function_ref INTERFACE ${CMAKE_SOURCE_DIR} )
7+ set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR} /cmake/tl-cmake" ${CMAKE_MODULE_PATH} )
8+ include (add-tl)
229
23- target_link_libraries (tests Catch function_ref)
24- set_property ( TARGET tests PROPERTY CXX_STANDARD 14 )
10+ tl_add_library(function-ref SOURCES
11+ include /tl/function_ref.hpp )
2512
13+ # Prepare "Catch" library for other executables
14+ set (CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} /test )
15+ add_library (Catch INTERFACE )
16+ target_include_directories (Catch INTERFACE ${CATCH_INCLUDE_DIR} )
2617
27- find_package (standardese) # find standardese after installation
28-
29- # generates a custom target that will run standardese to generate the documentation
30- if (standardese_FOUND)
31- standardese_generate(function_ref
32- INCLUDE_DIRECTORY .
33- CONFIG ${CMAKE_SOURCE_DIR} /standardese.config
34- INPUT function_ref.hpp)
35- endif ()
18+ if (FUNCTION_REF_ENABLE_TESTS)
19+ # Make test executable
20+ set (TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR} /tests/main.cpp
21+ ${CMAKE_CURRENT_SOURCE_DIR} /tests/constructors.cpp
22+ ${CMAKE_CURRENT_SOURCE_DIR} /tests/call.cpp
23+ ${CMAKE_CURRENT_SOURCE_DIR} /tests/issues.cpp
24+ ${CMAKE_CURRENT_SOURCE_DIR} /tests/assignment.cpp)
25+
26+ add_executable (tests ${TEST_SOURCES} )
27+
28+ target_link_libraries (tests Catch function-ref)
29+
30+ set_property (TARGET tests PROPERTY CXX_STANDARD 14)
31+ endif ()
0 commit comments