Skip to content

Commit

Permalink
Merge 402990c into b5332d8
Browse files Browse the repository at this point in the history
  • Loading branch information
mokafolio committed May 17, 2023
2 parents b5332d8 + 402990c commit 5608d9c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
14 changes: 2 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ if(PMP_BUILD_VIS)

# setup STB Image (place *before* GLFW since GLFW has an old copy of
# stb_image_write.h)
include_directories(${STBI_SOURCE_DIR})
add_subdirectory(${STBI_SOURCE_DIR})

# Building only the GLFW lib
Expand All @@ -54,28 +53,19 @@ if(PMP_BUILD_VIS)
if(NOT EMSCRIPTEN)
add_subdirectory(${GLFW_SOURCE_DIR} ${GLEW_SOURCE_DIR})

include_directories(${GLFW_SOURCE_DIR}/include ${GLFW_SOURCE_DIR}/deps
${GLEW_SOURCE_DIR}/include)

add_definitions(-DGLEW_STATIC)
add_library(glew STATIC ${GLEW_SOURCE_DIR}/src/glew.c
${GLEW_SOURCE_DIR}/include)
set_property(TARGET glew PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(glew PUBLIC ${GLEW_SOURCE_DIR}/include
${GLFW_SOURCE_DIR}/include)
target_link_libraries(glew ${GLFW_LIBRARIES})
endif()

# setup IMGUI
include_directories(${IMGUI_SOURCE_DIR})
add_subdirectory(${IMGUI_SOURCE_DIR})
endif(PMP_BUILD_VIS)

# setup Eigen
set(EIGEN_SOURCE_DIR "external/eigen")
include_directories(${EIGEN_SOURCE_DIR})

include(AddFileDependencies)
include_directories(${PROJECT_SOURCE_DIR}/src/)

# setup for code coverage testing
if(CMAKE_BUILD_TYPE STREQUAL "Debug"
AND ENABLE_COVERAGE
Expand Down
6 changes: 4 additions & 2 deletions external/imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_library(imgui STATIC ${SOURCES} ${HEADERS})
target_link_libraries(imgui ${CMAKE_DL_LIBS})
set_property(TARGET imgui PROPERTY POSITION_INDEPENDENT_CODE ON)
#TODO: instead of linking glew to get the glfw includ dir, maybe just use a global variable?
target_link_libraries(imgui ${CMAKE_DL_LIBS} glew)
target_include_directories(imgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_property(TARGET imgui PROPERTY POSITION_INDEPENDENT_CODE ON)
2 changes: 1 addition & 1 deletion external/stb_image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ if(UNIX)
endif()

add_library(stb_image STATIC ${HDRS} ${SRCS})
target_include_directories(stb_image PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(stb_image PROPERTIES POSITION_INDEPENDENT_CODE ON)

9 changes: 6 additions & 3 deletions src/pmp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ endif()
if(NOT EMSCRIPTEN AND PMP_INSTALL)

target_include_directories(
pmp PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<INSTALL_INTERFACE:include/>)
pmp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external/eigen>
$<INSTALL_INTERFACE:include/>)

target_compile_features(pmp PUBLIC cxx_std_17)

Expand All @@ -37,7 +39,8 @@ if(NOT EMSCRIPTEN AND PMP_INSTALL)
DESTINATION include)

install(FILES ${HEADERS} DESTINATION include/pmp/)

else()
target_include_directories(pmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ../../external/eigen)
endif()

if(PMP_BUILD_VIS)
Expand Down

0 comments on commit 5608d9c

Please sign in to comment.