diff options
author | Joe Hunkeler <jhunk@roden.local.stsci.edu> | 2021-05-04 17:34:38 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2021-05-04 21:14:16 -0400 |
commit | ea6e2613aca23c84373e686d739498969062f79e (patch) | |
tree | ba9cf39409056cad0b65a4ee953856230e73196b /CMakeLists.txt | |
download | cleanpath-ea6e2613aca23c84373e686d739498969062f79e.tar.gz |
Initial commit
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..096a49e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.0) +project(clean_path) + +set(CMAKE_C_STANDARD 99) +include_directories(${CMAKE_SOURCE_DIR}/include) +set(LIB_SOURCES lib/cleanpath.c) +set(MAIN_SOURCES src/main.c) +set(INCLUDES include/cleanpath.h) + +add_library(cleanpath_static STATIC ${LIB_SOURCES}) +set_target_properties(cleanpath_static PROPERTIES PUBLIC_HEADER ${INCLUDES}) +set_target_properties(cleanpath_static PROPERTIES OUTPUT_NAME cleanpath) + +add_library(cleanpath_shared SHARED ${LIB_SOURCES}) +set_target_properties(cleanpath_shared PROPERTIES PUBLIC_HEADER ${INCLUDES}) +set_target_properties(cleanpath_shared PROPERTIES OUTPUT_NAME cleanpath) + +add_executable(cleanpath ${MAIN_SOURCES}) +target_link_libraries(cleanpath cleanpath_static) + +install(TARGETS cleanpath_static + PUBLIC_HEADER DESTINATION include + LIBRARY DESTINATION lib) + +install(TARGETS cleanpath_shared + PUBLIC_HEADER DESTINATION include + LIBRARY DESTINATION lib) + +install(TARGETS cleanpath + RUNTIME DESTINATION bin) + +install(FILES ${CMAKE_SOURCE_DIR}/docs/man/cleanpath.1 + DESTINATION share/man/man1 COMPONENT doc)
\ No newline at end of file |