Skip to content

Commit

Permalink
Trying it out
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenvp committed Jan 29, 2021
1 parent 383626f commit 40c22f2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CMakeLists.txt
Expand Up @@ -7,22 +7,30 @@ if(NOT DEFINED STEINWURF_RESOLVE)
COMMAND python waf resolve
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(STEINWURF_RESOLVE "${CMAKE_CURRENT_SOURCE_DIR}/resolve_symlinks")
set(CPUID_TOPLEVEL 1)
endif()

file(GLOB cpuid_headers ./src/cpuid/*.hpp)
file(GLOB_RECURSE cpuid_sources ./src/*.cpp)
add_library(cpuid STATIC ${cpuid_sources})
add_library(steinwurf::cpuid ALIAS cpuid)

add_library(cpuid_objects OBJECT ${cpuid_sources})
add_library(steinwurf::cpuid ALIAS cpuid_objects)

if (NOT TARGET platform)
add_subdirectory("${STEINWURF_RESOLVE}/platform" platform EXCLUDE_FROM_ALL)
endif()

target_link_libraries(cpuid PRIVATE steinwurf::platform)
target_link_libraries(cpuid_objects PRIVATE steinwurf::platform)

target_compile_features(cpuid PUBLIC cxx_std_11)
target_compile_features(cpuid_objects PUBLIC cxx_std_11)

target_include_directories(cpuid INTERFACE src)
target_include_directories(cpuid_objects INTERFACE src)

install(FILES ${cpuid_headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/cpuid)


if (DEFINED CPUID_TOPLEVEL)
add_library(cpuid STATIC $<TARGET_OBJECTS:cpuid_objects>)
install(FILES $<TARGET_FILE:cpuid> DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
endif()

0 comments on commit 40c22f2

Please sign in to comment.