forked from hsf-training/cpluspluscourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
23 lines (19 loc) · 920 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Set up the project.
cmake_minimum_required( VERSION 3.12 )
project( polymorhism LANGUAGES CXX )
# Set up the compilation environment.
include( "${CMAKE_CURRENT_SOURCE_DIR}/../common.cmake" )
# Create the user's library.
add_library( polymorphismPoly "Polygons.hpp" "Polygons.cpp" )
target_include_directories( polymorphismPoly PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" )
set_target_properties( polymorphismPoly PROPERTIES OUTPUT_NAME "poly" )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" )
target_compile_definitions( polymorphismPoly PRIVATE _USE_MATH_DEFINES )
endif()
# Create the user's executable.
add_executable( trypoly "trypoly.cpp" )
target_link_libraries( trypoly PRIVATE polymorphismPoly )
# Create the "solution executable".
add_executable( trypoly.sol EXCLUDE_FROM_ALL "solution/trypoly.sol.cpp" )
target_link_libraries( trypoly.sol PRIVATE polymorphismPoly )
add_dependencies( solution trypoly.sol )