-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
32 lines (24 loc) · 901 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
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
project(wxx LANGUAGES CXX)
include(GNUInstallDirs)
if( APPLE )
set( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall" )
else()
set( CMAKE_CXX_FLAGS "-std=c++11 -Wall -pthread" )
endif()
include_directories("include")
file(GLOB src src/*.cpp src/*.h include/${PROJECT_NAME}/*.h)
add_library(${PROJECT_NAME} ${src})
# Attach header directory information
# to the targets for when we are part of a parent build (ie being pulled
# in via add_subdirectory() rather than being a standalone build).
target_include_directories(${PROJECT_NAME} INTERFACE "include")
# Install rules
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib"
RUNTIME DESTINATION "bin"
)
install(DIRECTORY include/${PROJECT_NAME} DESTINATION include)
add_executable(hello sample/hello.cpp)
target_link_libraries(hello ${PROJECT_NAME})