From 5252b5924899a5155fb1de879d169e528421675a Mon Sep 17 00:00:00 2001 From: Dongxu Li Date: Mon, 28 Aug 2023 10:37:10 -0400 Subject: [PATCH] boost --- CMakeLists.txt | 6 +++--- lcUI/CMakeLists.txt | 8 ++------ lcadluascript/CMakeLists.txt | 5 ++--- lckernel/CMakeLists.txt | 9 +++++---- lcviewernoqt/CMakeLists.txt | 6 +++--- luacmdinterface/CMakeLists.txt | 5 +++-- persistence/CMakeLists.txt | 4 ++-- unittest/CMakeLists.txt | 5 +++-- 8 files changed, 23 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d402187..135bea40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/conan_toolchain.cmake") find_package(GLEW REQUIRED) - set(EIGEN3_INCLUDE_DIR "${CONAN_INCLUDE_DIRS_EIGEN}") + set(Eigen3_INCLUDE_DIR "${CONAN_INCLUDE_DIRS_EIGEN}") set(ENV{LUA_DIR} "${CONAN_LUA_ROOT}") @@ -82,7 +82,7 @@ endif() if(MSVC) find_package(Eigen3 REQUIRED) - include_directories(${EIGEN3_INCLUDE_DIR}) + include_directories(${Eigen3_INCLUDE_DIR}) find_package(libdxfrw REQUIRED) include_directories(${libdxfrw_INCLUDE_DIR}) find_package(freetype REQUIRED) @@ -93,7 +93,7 @@ if(MSVC) include_directories(${glm_INCLUDE_DIR}) add_definitions("/bigobj") set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " /w /wd4710 /wd4711 /wd4668 /wd5045 /wd9002 /wd4365 /wd4242") + SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " /w /wd4710 /wd4711 /wd4668 /wd5045 /wd4365 /wd4242") SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} " /w /wd4710 /wd4711") # Kaguya uses a pointer to a local variable (in object.hpp file) to store class conversions. # When used in different modules, the variable doesn't have the same address, preventing to mix kernel and UI bindings diff --git a/lcUI/CMakeLists.txt b/lcUI/CMakeLists.txt index 6d9188b5..7157b267 100644 --- a/lcUI/CMakeLists.txt +++ b/lcUI/CMakeLists.txt @@ -195,9 +195,9 @@ ui/resource.qrc) # Eigen 3 find_package(Eigen3 REQUIRED) if(CMAKE_COMPILER_IS_GNUCXX) - include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) + include_directories(SYSTEM ${Eigen3_INCLUDE_DIR}) else() - include_directories(${EIGEN3_INCLUDE_DIR}) + include_directories(${Eigen3_INCLUDE_DIR}) endif() # Boost logging @@ -267,10 +267,6 @@ set(EXTRA_LIBS Qt5::Svg ${APR_LIBRARIES}) -if (MSVC) - set(EXTRA_LIBS ${EXTRA_LIBS} Boost::log) -endif() - #Create library for unit tests if(WITH_UNITTESTS) add_library(lcui SHARED ${UI_srcs} ${UI_hdrs} ${UI_HEADERS} ${UI_RESOURCES}) diff --git a/lcadluascript/CMakeLists.txt b/lcadluascript/CMakeLists.txt index c9d51c1c..7d32729a 100644 --- a/lcadluascript/CMakeLists.txt +++ b/lcadluascript/CMakeLists.txt @@ -47,7 +47,7 @@ set(lcluascript_hdrs # Eigen 3 find_package(Eigen3 REQUIRED) if( CMAKE_COMPILER_IS_GNUCXX) - include_directories( SYSTEM ${EIGEN3_INCLUDE_DIR}) + include_directories( SYSTEM ${Eigen3_INCLUDE_DIR}) else () include_directories( ${Eigen3_INCLUDE_DIR}) endif () @@ -83,8 +83,7 @@ target_link_libraries(lcluascript ${LUA_LIBRARIES} lckernel) if (MSVC) find_package(glew REQUIRED) - find_package(boost REQUIRED) - target_link_libraries(lcluascript ${LUA_LIBRARIES} lckernel Eigen3::Eigen GLEW::GLEW Boost::log) + target_link_libraries(lcluascript ${LUA_LIBRARIES} lckernel Eigen3::Eigen GLEW::GLEW ${Boost_LIBRARIES}) endif() # INSTALLATION diff --git a/lckernel/CMakeLists.txt b/lckernel/CMakeLists.txt index b99be662..9626b193 100644 --- a/lckernel/CMakeLists.txt +++ b/lckernel/CMakeLists.txt @@ -234,10 +234,12 @@ cad/objects/pattern.h ) # Boost logging -find_package(Boost REQUIRED) + + +find_package(Boost REQUIRED COMPONENTS log REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) -link_directories(boost_dirs="${Boost_LIBRARY_DIRS}") +message(boost_dirs="${Boost_LIBRARY_DIRS}") include_directories("${CMAKE_SOURCE_DIR}/lckernel") include_directories("${CMAKE_SOURCE_DIR}/lcviewernoqt") @@ -245,7 +247,7 @@ include_directories("${CMAKE_SOURCE_DIR}/lcviewernoqt") # Eigen 3 find_package(Eigen3 REQUIRED) if(CMAKE_COMPILER_IS_GNUCXX) - include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) + include_directories(SYSTEM ${Eigen3_INCLUDE_DIR}) else() include_directories(${Eigen3_INCLUDE_DIR}) endif() @@ -283,7 +285,6 @@ if (MSVC) set_target_properties(lckernel PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Boost_LIBRARY_DIRS}" ) - target_link_libraries(lckernel boost::boost Boost::log Boost::log_setup) endif() # INSTALLATION diff --git a/lcviewernoqt/CMakeLists.txt b/lcviewernoqt/CMakeLists.txt index 2d662077..69932ee7 100644 --- a/lcviewernoqt/CMakeLists.txt +++ b/lcviewernoqt/CMakeLists.txt @@ -151,7 +151,7 @@ add_custom_command( ) # Boost logging -find_package(Boost REQUIRED COMPONENTS log) +find_package(Boost COMPONENTS log REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) @@ -188,9 +188,9 @@ find_package(BZip2) # Eigen 3 find_package(Eigen3 REQUIRED) if( CMAKE_COMPILER_IS_GNUCXX) - include_directories( SYSTEM ${EIGEN3_INCLUDE_DIR}) + include_directories( SYSTEM ${Eigen3_INCLUDE_DIR}) else () - include_directories( ${EIGEN3_INCLUDE_DIR}) + include_directories( ${Eigen3_INCLUDE_DIR}) endif () # BUILDING CONFIG diff --git a/luacmdinterface/CMakeLists.txt b/luacmdinterface/CMakeLists.txt index b8f7f9be..dc6892c9 100644 --- a/luacmdinterface/CMakeLists.txt +++ b/luacmdinterface/CMakeLists.txt @@ -15,15 +15,16 @@ find_package(glfw3 3.2 REQUIRED) # Eigen 3 find_package(Eigen3 REQUIRED) if( CMAKE_COMPILER_IS_GNUCXX) - include_directories( SYSTEM ${EIGEN3_INCLUDE_DIR}) + include_directories( SYSTEM ${Eigen3_INCLUDE_DIR}) else () - include_directories( ${EIGEN3_INCLUDE_DIR}) + include_directories( ${Eigen3_INCLUDE_DIR}) endif () # Boost find_package(Boost COMPONENTS program_options filesystem system log date_time thread log_setup REQUIRED) FIND_PACKAGE ( Threads REQUIRED ) include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) #Lua find_package(Lua 5.3 EXACT REQUIRED) diff --git a/persistence/CMakeLists.txt b/persistence/CMakeLists.txt index 4030f486..68167bf8 100644 --- a/persistence/CMakeLists.txt +++ b/persistence/CMakeLists.txt @@ -33,9 +33,9 @@ link_directories(${Boost_LIBRARY_DIRS}) # Eigen 3 find_package(Eigen3 REQUIRED) if( CMAKE_COMPILER_IS_GNUCXX) - include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) + include_directories(SYSTEM ${Eigen3_INCLUDE_DIR}) else () - include_directories(${EIGEN3_INCLUDE_DIR}) + include_directories(${Eigen3_INCLUDE_DIR}) endif () # BUILDING CONFIG diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 5c2d1463..f76c9fe8 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -10,9 +10,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Eigen 3 find_package(Eigen3 REQUIRED) if( CMAKE_COMPILER_IS_GNUCXX) - include_directories( SYSTEM ${EIGEN3_INCLUDE_DIR}) + include_directories( SYSTEM ${Eigen3_INCLUDE_DIR}) else () - include_directories( ${EIGEN3_INCLUDE_DIR}) + include_directories( ${Eigen3_INCLUDE_DIR}) endif () # LibbDXFRW @@ -141,6 +141,7 @@ if(WITH_RENDERING_UNITTESTS) set(Boost_USE_MULTITHREADED ON) find_package(Boost COMPONENTS program_options filesystem system log REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) + link_directories(${Boost_LIBRARY_DIRS}) find_package(glfw3 3.2 REQUIRED)