removing static libs and changing flags

This commit is contained in:
Erik Frojdh
2019-01-15 16:56:33 +01:00
parent 8bc9fa54fc
commit 7303734b19
3 changed files with 24 additions and 37 deletions

View File

@ -11,11 +11,16 @@ option (USE_RECEIVER "Receiver" OFF)
option (USE_GUI "GUI" OFF)
option (USE_TESTS "TESTS" ON)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -Wno-misleading-indentation")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 ")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 ")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# clang does not support -Wno-misleading-indentation
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation")
endif()
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread")

View File

@ -4,28 +4,19 @@ set(SOURCES
slsDetector/slsDetectorUsers.cpp
slsDetector/slsDetectorCommand.cpp
slsDetector/slsDetector.cpp
../slsSupportLib/include/ClientInterface.cpp
../slsSupportLib/include/utilities.cpp
../slsSupportLib/src/string_utils.cpp
${PROJECT_SOURCE_DIR}/slsSupportLib/include/ClientInterface.cpp
${PROJECT_SOURCE_DIR}/slsSupportLib/include/utilities.cpp
${PROJECT_SOURCE_DIR}/slsSupportLib/src/string_utils.cpp
)
set(HEADERS
)
include_directories(
../slsSupportLib/include
multiSlsDetector
sharedMemory
slsDetector
)
add_library(slsDetectorStatic STATIC
${SOURCES}
${HEADERS}
)
set_target_properties(slsDetectorStatic PROPERTIES
ARCHIVE_OUTPUT_NAME SlsDetector
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
${PROJECT_SOURCE_DIR}/slsSupportLib/include
multiSlsDetector
sharedMemory
slsDetector
)
add_library(slsDetectorShared SHARED
@ -38,7 +29,6 @@ target_link_libraries(slsDetectorShared
)
set(PUBLICHEADERS
${PROJECT_SOURCE_DIR}/slsSupportLib/include/sls_detector_defs.h
${PROJECT_SOURCE_DIR}/slsSupportLib/include/sls_detector_funcs.h
@ -61,8 +51,6 @@ set_target_properties(slsDetectorShared PROPERTIES
PUBLIC_HEADER "${PUBLICHEADERS}"
)
add_subdirectory(slsDetectorClient)
if(DOXYGEN_FOUND)
@ -75,7 +63,8 @@ if(DOXYGEN_FOUND)
endif()
install(TARGETS slsDetectorShared slsDetectorStatic
install(TARGETS slsDetectorShared
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib)
ARCHIVE DESTINATION lib
)

View File

@ -41,15 +41,6 @@ include_directories(
)
add_library(slsReceiverStatic STATIC
${SOURCES}
${HEADERS}
)
set_target_properties(slsReceiverStatic PROPERTIES
ARCHIVE_OUTPUT_NAME SlsReceiver
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
add_library(slsReceiverShared SHARED
${SOURCES}
${HEADERS}
@ -79,6 +70,7 @@ add_executable(slsReceiver
set_target_properties(slsReceiver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_link_libraries(slsReceiver
slsReceiverShared
pthread
@ -92,10 +84,11 @@ endif ()
install(TARGETS slsReceiverShared slsReceiverStatic slsReceiver
install(TARGETS slsReceiverShared slsReceiver
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include)
PUBLIC_HEADER DESTINATION include
)