blob: f806d7dbe0f5f8501521f2dbc40d030990cea7e3 (
plain)
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
|
cmake_minimum_required (VERSION 2.8)
set(lib_name hello_ci_world)
project (${lib_name})
file(GLOB SRC
"src/*.c"
"src/*.cpp"
)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)
# static Library Output
add_library(${lib_name} STATIC ${SRC})
set_target_properties(${lib_name} PROPERTIES OUTPUT_NAME ${lib_name})
add_executable(test_hello_ci_world test/test.c)
target_link_libraries(test_hello_ci_world ${lib_name})
set(CMAKE_INSTALL_RPATH ${CMAKE_SOURCE_DIR}/lib)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
#install(TARGETS ${lib_name} LIBRARY DESTINATION ${CMAKE_SOURCE_DIR}/lib)
install(TARGETS test_hello_ci_world DESTINATION ${CMAKE_SOURCE_DIR}/test)
|