Skip to content

Commit

Permalink
Remove target
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesschrimpf committed May 31, 2024
1 parent 2b07a1f commit 42cf9f7
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ message(STATUS "FMT_LIBRARIES = ${FMT_LIBRARIES}")

find_package(spdlog REQUIRED)
set(SPDLOG_LIB spdlog::spdlog)

if("${SPDLOG_LIBRARIES}" STREQUAL "")
set(SPDLOG_LIBRARIES spdlog::spdlog)
set(SPDLOG_LIBRARIES spdlog::spdlog)
endif()

find_package(eventpp CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)

if("${magic_enum_LIBRARIES}" STREQUAL "")
set(magic_enum_LIBRARIES magic_enum::magic_enum)
set(magic_enum_LIBRARIES magic_enum::magic_enum)
endif()


add_definitions(-DSPDLOG_COMPILED_LIB)
add_definitions(-DSPDLOG_FMT_EXTERNAL=1)

Expand Down Expand Up @@ -64,28 +65,20 @@ target_link_directories(oculus_driver PUBLIC ${EXT_LIB_DIRS})
target_link_libraries(oculus_driver PUBLIC ${EXT_LIBS})
target_compile_definitions(oculus_driver PUBLIC MAGIC_ENUM_RANGE_MAX=1024)

#############
## Install ##
#############
# ############
# # Install ##
# ############
include(GNUInstallDirs)

install(DIRECTORY include/oculus_driver
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

install(TARGETS ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}
EXPORT ${PROJECT_NAME}Targets)

# install the exported targets
install(EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}Targets.cmake
# NAMESPACE ${PROJECT_NAME}:: # namespacing does not play well with fetch content
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
DESTINATION ${CMAKE_INSTALL_LIBDIR})

############
## Config ##
############
# ###########
# # Config ##
# ###########
set(INCLUDE_INSTALL_DIR include)
set(LIB_INSTALL_DIR lib)

Expand All @@ -105,10 +98,6 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION lib/cmake/${PROJECT_NAME}
)
export(EXPORT ${PROJECT_NAME}Targets
# NAMESPACE ${PROJECT_NAME}:: # namespacing does not play well with fetch content
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake"
)

if(BUILD_TESTS)
add_subdirectory(tests)
Expand Down

0 comments on commit 42cf9f7

Please sign in to comment.