You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
803 B
35 lines
803 B
cmake_minimum_required(VERSION 3.10)
|
|
|
|
# set the project name
|
|
project(Tutorial VERSION 1.0)
|
|
|
|
# specify the C++ standard
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
|
|
option(USE_MYMATH "Use tutorial provided math implementation" ON)
|
|
|
|
if(USE_MYMATH)
|
|
add_subdirectory(MathFunctions)
|
|
list(APPEND EXTRA_LIBS MathFunctions)
|
|
endif()
|
|
|
|
configure_file(TutorialConfig.h.in TutorialConfig.h)
|
|
|
|
add_executable(Tutorial tutorial.cxx)
|
|
|
|
target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
|
|
|
|
target_include_directories(Tutorial PUBLIC
|
|
"${PROJECT_BINARY_DIR}"
|
|
)
|
|
|
|
install(TARGETS Tutorial DESTINATION /home/key/Git/cmake/tutorial/bin)
|
|
install(FILES ${PROJECT_BINARY_DIR}/TutorialConfig.h
|
|
DESTINATION /home/key/Git/cmake/tutorial/include
|
|
)
|
|
|
|
|
|
|
|
|