-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (39 loc) · 1.7 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required (VERSION 3.12)
project (EMSim)
#---------------------------------------------------------------------------------------
# main project
#---------------------------------------------------------------------------------------
# find all source and header files
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp" "src/*.hpp" "src/*.inl")
# organize the files according to the organization in the file system
# from: http:#cmake.3232098.n2.nabble.com/Keep-folder-structure-in-Visual-Studio-Project-generated-with-CMake-td7586044.html
macro(GroupSources curdir)
file(GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir} ${PROJECT_SOURCE_DIR}/${curdir}/*)
foreach(child ${children})
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child})
GroupSources(${curdir}/${child})
else()
string(REPLACE "/" "\\" groupname ${curdir})
source_group(${groupname} FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child})
endif()
endforeach()
endmacro()
# execute the macro
GroupSources(src)
add_executable(EMSim ${SOURCE_FILES})
set_target_properties(EMSim PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED YES
)
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result)
set_property(TARGET EMSim PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
endif()
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT EMSim)
#---------------------------------------------------------------------------------------
# libraries
#---------------------------------------------------------------------------------------
add_subdirectory ("${CMAKE_CURRENT_SOURCE_DIR}/../AcaEngine/" "dependencies")
target_link_libraries(EMSim PUBLIC AcaEngine)
target_include_directories(EMSim PRIVATE "src")