Skip to content

Commit

Permalink
boost
Browse files Browse the repository at this point in the history
  • Loading branch information
dxli committed Aug 28, 2023
1 parent 2b134ef commit 5252b59
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 25 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
8 changes: 2 additions & 6 deletions lcUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})
Expand Down
5 changes: 2 additions & 3 deletions lcadluascript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions lckernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,20 @@ 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")

# 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()
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lcviewernoqt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions luacmdinterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions persistence/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 5252b59

Please sign in to comment.