-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
26 lines (22 loc) · 1.21 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
cmake_minimum_required(VERSION 3.8)
project(VividImage)
set(CMAKE_CXX_STANDARD 11)
set(BUILD_LIBRARY false)
set(MAIN_FILE main.cpp)
set(HEADER_FILES image.h bitarray.h node.h tree.h)
set(CPP_FILES image.cpp bitarray.cpp tree.cpp)
if (BUILD_LIBRARY)
FILE(REMOVE_RECURSE bin/library/)
add_library(VividImage STATIC ${CPP_FILES})
set_target_properties(VividImage PROPERTIES PREFIX "")
set_target_properties(VividImage PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/library/VividImage/libs/")
FILE(COPY ${HEADER_FILES} DESTINATION "${PROJECT_SOURCE_DIR}/bin/library/VividImage/include/VividImage/")
FILE(COPY ${HEADER_FILES} ${CPP_FILES} DESTINATION "${PROJECT_SOURCE_DIR}/bin/library/VividImage/src/VividImage/")
FILE(COPY librarydependecies/CMakeLists.txt DESTINATION "${PROJECT_SOURCE_DIR}/bin/library/VividImage/")
else (BUILD_LIBRARY)
FILE(REMOVE_RECURSE bin/debug/)
add_executable(VividImage ${MAIN_FILE} ${HEADER_FILES} ${CPP_FILES} "${PROJECT_SOURCE_DIR}/exe_res/project.rc")
set_target_properties(VividImage PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/debug/")
FILE(GLOB RES_FILES res/*)
FILE(COPY ${RES_FILES} DESTINATION "${PROJECT_SOURCE_DIR}/bin/debug/")
endif (BUILD_LIBRARY)