diff --git a/CMakeLists.txt b/CMakeLists.txt index bed11c2..c4bb5f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ find_package(cxxopts CONFIG) set(RAPTOR_EAGLEV_LIB raptor_eaglev) -option(STATIC_LIB "Create static '${RAPTOR_EAGLEV_LIB}' library" OFF) +option(RAPROT_SHARED_LIB "Create shared '${RAPTOR_EAGLEV_LIB}' library" OFF) set(RAPTOR_EAGLEV_LIB_SRC raptor_eagle_ccd.h @@ -27,10 +27,10 @@ set(RAPTOR_EAGLEV_LIB_SRC raptor_eagle_exception.h raptor_eagle_acqproc.cpp) -if (STATIC_LIB) - add_library(${RAPTOR_EAGLEV_LIB} STATIC ${RAPTOR_EAGLEV_LIB_SRC}) -else() +if (RAPROT_SHARED_LIB) add_library(${RAPTOR_EAGLEV_LIB} SHARED ${RAPTOR_EAGLEV_LIB_SRC}) +else() + add_library(${RAPTOR_EAGLEV_LIB} STATIC ${RAPTOR_EAGLEV_LIB_SRC}) endif() # include(FetchContent) @@ -69,13 +69,13 @@ add_executable(${RAPTOR_EAGLEV_SERVER} raptor_eaglev_server.cpp) target_link_libraries(${RAPTOR_EAGLEV_SERVER} PUBLIC ${RAPTOR_EAGLEV_LIB} cxxopts::cxxopts) include(GNUInstallDirs) -if (STATIC_LIB) # install only server binary - install(TARGETS ${RAPTOR_EAGLEV_SERVER} +if (RAPROT_SHARED_LIB) # install shared library and server binary + install(TARGETS ${RAPTOR_EAGLEV_LIB} ${RAPTOR_EAGLEV_SERVER} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) else() - install(TARGETS ${RAPTOR_EAGLEV_LIB} ${RAPTOR_EAGLEV_SERVER} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + install(TARGETS ${RAPTOR_EAGLEV_SERVER} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) endif()