Commit e79af566 authored by fmg005's avatar fmg005

fixed libconfig bug

parent d2b4918b
......@@ -8,7 +8,7 @@ include(ExternalProject)
ExternalProject_Add( serial
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/serial
GIT_REPOSITORY https://github.com/wjwwood/serial.git
BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty//serial/build
BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/serial/build
UPDATE_COMMAND ""
BUILD_COMMAND make
INSTALL_COMMAND make install
......@@ -23,23 +23,13 @@ set_target_properties(libserial PROPERTIES IMPORTED_LOCATION ${install_dir}/lib/
add_dependencies(libserial serial)
set(serial_INCLUDE_DIR ${install_dir}/include)
#--------------------------------------------------------------------------------
ExternalProject_Add( libconfig
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/libconfig
GIT_REPOSITORY "https://github.com/hyperrealm/libconfig.git"
UPDATE_COMMAND ""
INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/libconfig"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=<INSTALL_DIR>
)
#------------------------------------------------------------------------------------
# use dpkg -L libconfig++-dev to find the location of libconfig.h++ and libconfig++.a
find_path(CONFIG++_INCLUDE_DIR libconfig.h++ /usr/include/)
find_library(CONFIG++_LIBRARY NAMES libconfig++.a PATH /usr/lib/x86_64-linux-gnu/libconfig++.a)
ExternalProject_Get_Property(libconfig install_dir)
add_library(libconfig++ SHARED IMPORTED)
set_target_properties(libconfig++ PROPERTIES IMPORTED_LOCATION ${install_dir}/lib/liblibconfig++.so)
add_dependencies(libconfig++ libconfig)
set(libconfig++_INCLUDE_DIR ${install_dir}/include)
#-----------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
#prosim depends on pulse this will call will give you access to pulse directories
#needed by prosim
find_package(Pulse REQUIRED NO_MODULE)
......@@ -67,6 +57,7 @@ set( my_srcs
Monitor.cpp
SimMonitor.cpp
PatientOut.cpp
#Prosim.cpp
)
add_executable(prosim ${my_srcs})
......@@ -77,14 +68,14 @@ target_include_directories(prosim PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/include
${serial_INCLUDE_DIR}
${Pulse_INCLUDE_DIRS}
${libconfig++_INCLUDE_DIR})
${CONFIG++_INCLUDE_DIR})
#libraries
target_link_libraries(prosim debug "${Pulse_DEBUG_LIBS}")
target_link_libraries(prosim optimized
${Pulse_LIBS}
libconfig++
${CONFIG++_LIBRARY}
libserial
${CMAKE_CURRENT_SOURCE_DIR}/lib/liblibprosim.a)
libprosim)
install(TARGETS prosim DESTINATION ${Pulse_INSTALL}/bin)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment