-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (30 loc) · 980 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.14)
project(optimus-cpp LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 3)
set(PROJECT_VERSION_PATCH 0)
option(BUILD_SHARED_LIBS OFF)
option(BUILD_TEST OFF)
if(BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif()
add_library(optimus-cpp
src/optimus.h
src/optimus.cpp
)
if (BUILD_SHARED_LIBS)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/optimus-cpp.dll DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/optimus-cpp.lib DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
else()
install(TARGETS optimus-cpp DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
endif()
install(FILES src/optimus.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
if (BUILD_TEST)
add_executable(optimus-cpp-test
test/main.cpp
)
target_link_libraries(optimus-cpp-test PRIVATE optimus-cpp)
endif()