Skip to content
Snippets Groups Projects
Commit ad20686f authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Fix adding libraries without source files

parent df559d40
No related branches found
No related tags found
No related merge requests found
PROJECT ( SimoxQtUtility )
MESSAGE (STATUS "\n***** CONFIGURING Simox project SimoxQtUtility *****")
#################################### FILES ##################################
SET(SOURCES
)
SET(INCLUDES
)
if (qwt_FOUND)
list(APPEND INCLUDES
qwt/SimoxQwtColorMap.h
qwt/SimoxQwtSpectrogramData.h
)
list(APPEND SOURCES
qwt/SimoxQwtColorMap.cpp
qwt/SimoxQwtSpectrogramData.cpp
)
endif()
# Generate subdirectory headers
simox_generate_subdir_headers(
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}
INCLUDES
)
#######################################################################
# Add library
#######################################################################
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
add_library(SimoxQtUtility SHARED)
add_library(SimoxQtUtility SHARED
${SOURCES}
${INCLUDES}
)
target_include_directories(SimoxQtUtility PUBLIC
$<BUILD_INTERFACE:${Simox_SOURCE_DIR}>
......@@ -11,10 +46,12 @@ target_include_directories(SimoxQtUtility PUBLIC
target_compile_options(SimoxQtUtility PUBLIC ${Simox_OS_compile_options})
target_link_libraries(SimoxQtUtility PUBLIC SimoxUtility)
#######################################################################
# Setup dependencies
#######################################################################
####
####
if ( Qt5_FOUND )
MESSAGE (STATUS "Found Qt5: " ${Qt5Gui_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} )
target_link_libraries(SimoxQtUtility PUBLIC Qt5::Core Qt5::Gui Qt5::OpenGL Qt5::Widgets)
......@@ -29,29 +66,8 @@ if (qwt_FOUND)
else ()
MESSAGE (STATUS "Did not find Qwt. Disabling Qwt support.")
endif()
##########################################################################################################
##########################################################################################################
##########################################################################################################
MESSAGE (STATUS "\n***** CONFIGURING Simox project SimoxQtUtility *****")
#################################### FILES ##################################
SET(SOURCES)
SET(INCLUDES)
if (qwt_FOUND)
list(APPEND INCLUDES qwt/SimoxQwtColorMap.h
qwt/SimoxQwtSpectrogramData.h)
list(APPEND SOURCES qwt/SimoxQwtColorMap.cpp
qwt/SimoxQwtSpectrogramData.cpp)
endif()
##########################################################################################################
#################################### generate_subdir_headers ##################################
simox_generate_subdir_headers(
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}
INCLUDES
)
##########################################################################################################
##########################################################################################################
##########################################################################################################
......@@ -67,8 +83,6 @@ endif()
# Finished adding UI files
#-----------------------------------------------------------------------------------
set_target_properties(SimoxQtUtility PROPERTIES SOURCES "${SOURCES};${INCLUDES}")
SET_TARGET_PROPERTIES(SimoxQtUtility PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${Simox_BIN_DIR})
SET_TARGET_PROPERTIES(SimoxQtUtility PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${Simox_LIB_DIR})
SET_TARGET_PROPERTIES(SimoxQtUtility PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${Simox_LIB_DIR})
......
PROJECT ( SimoxUtility )
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
add_library(SimoxUtility SHARED) # SimoxUtility.h) # sources will be added later
target_include_directories(SimoxUtility PUBLIC
$<BUILD_INTERFACE:${Simox_SOURCE_DIR}>
$<BUILD_INTERFACE:${Simox_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)
target_compile_options(SimoxUtility PUBLIC ${Simox_OS_compile_options})
target_link_libraries(SimoxUtility PUBLIC stdc++fs)
#######################################################################
# Setup dependencies
#######################################################################
#### Eigen
target_include_directories(SimoxUtility SYSTEM PUBLIC ${Eigen3_INCLUDE_DIR})
#### BOOST
target_link_libraries(SimoxUtility PUBLIC
Boost::boost
Boost::program_options
Boost::thread
Boost::regex
)
target_compile_options(SimoxUtility PUBLIC -include SimoxUtility/eigen/AssertAsException.h)
MESSAGE (STATUS "\n***** CONFIGURING Simox project SimoxUtility *****")
# disable boost auto linking
if (Boost_USE_STATIC_LIBS)
target_compile_definitions(SimoxUtility PUBLIC -DBOOST_ALL_NO_LIB -DBOOST_TEST_MAIN)
else (Boost_USE_STATIC_LIBS)
# enable dynamic linking for specific boost libraries
target_compile_definitions(SimoxUtility PUBLIC
-DBOOST_ALL_NO_LIB
-DBOOST_PROGRAM_OPTIONS_DYN_LINK
-DBOOST_FILESYSTEM_DYN_LINK
-DBOOST_SYSTEM_DYN_LINK
-DBOOST_THREAD_DYN_LINK)
endif ()
##########################################################################################################
##########################################################################################################
##########################################################################################################
MESSAGE (STATUS "\n***** CONFIGURING Simox project SimoxUtility *****")
#################################### FILES ##################################
SET(SOURCES
......@@ -272,6 +234,64 @@ SET(INCLUDES
threads/CountingSemaphore.h
)
# Generate subdirectory headers
simox_generate_subdir_headers(
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}
INCLUDES
)
#######################################################################
# Add library
#######################################################################
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
add_library(SimoxUtility SHARED
${SOURCES}
${INCLUDES}
)
target_include_directories(SimoxUtility PUBLIC
$<BUILD_INTERFACE:${Simox_SOURCE_DIR}>
$<BUILD_INTERFACE:${Simox_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)
target_compile_options(SimoxUtility PUBLIC ${Simox_OS_compile_options})
target_link_libraries(SimoxUtility PUBLIC stdc++fs)
#######################################################################
# Setup dependencies
#######################################################################
#### Eigen
target_include_directories(SimoxUtility SYSTEM PUBLIC ${Eigen3_INCLUDE_DIR})
#### BOOST
target_link_libraries(SimoxUtility PUBLIC
Boost::boost
Boost::program_options
Boost::thread
Boost::regex
)
target_compile_options(SimoxUtility PUBLIC -include SimoxUtility/eigen/AssertAsException.h)
# disable boost auto linking
if (Boost_USE_STATIC_LIBS)
target_compile_definitions(SimoxUtility PUBLIC -DBOOST_ALL_NO_LIB -DBOOST_TEST_MAIN)
else (Boost_USE_STATIC_LIBS)
# enable dynamic linking for specific boost libraries
target_compile_definitions(SimoxUtility PUBLIC
-DBOOST_ALL_NO_LIB
-DBOOST_PROGRAM_OPTIONS_DYN_LINK
-DBOOST_FILESYSTEM_DYN_LINK
-DBOOST_SYSTEM_DYN_LINK
-DBOOST_THREAD_DYN_LINK)
endif ()
##########################################################################################################
#################################### generate meta functions ##################################
......@@ -321,14 +341,6 @@ make_check_for_member(
)
##########################################################################################################
#################################### generate_subdir_headers ##################################
simox_generate_subdir_headers(
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}
INCLUDES
)
##########################################################################################################
##########################################################################################################
##########################################################################################################
......@@ -344,8 +356,6 @@ endif()
# Finished adding UI files
#-----------------------------------------------------------------------------------
set_target_properties(SimoxUtility PROPERTIES SOURCES "${SOURCES};${INCLUDES}")
SET_TARGET_PROPERTIES(SimoxUtility PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${Simox_BIN_DIR})
SET_TARGET_PROPERTIES(SimoxUtility PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${Simox_LIB_DIR})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment