aboutsummaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
blob: ab8da60507cc221153c612f4e64372f9a3e57925 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../include
)

# These examples use the standard separate compilation
file(GLOB_RECURSE SOURCES_IDIOMATIC_EXAMPLES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "lesson*.cpp" "cs*lesson*.cpp" "example*.cpp")

string( REPLACE ".cpp" "" BASENAMES_IDIOMATIC_EXAMPLES "${SOURCES_IDIOMATIC_EXAMPLES}" )

set( TARGETS_IDIOMATIC_EXAMPLES "" )
foreach( name ${BASENAMES_IDIOMATIC_EXAMPLES} )
    set( TARGETS_IDIOMATIC_EXAMPLES "${TARGETS_IDIOMATIC_EXAMPLES};${name}" )
    if(${name} STREQUAL "lesson01_function")
        add_executable(${name} ${name}.cpp module_lesson01.cpp)
    else()
        add_executable(${name} ${name}.cpp)
    endif()
endforeach()

install(TARGETS ${TARGETS_IDIOMATIC_EXAMPLES} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})