Skip to content

Commit

Permalink
add CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettSJohnson committed Jan 31, 2024
1 parent 3543c7e commit 60565ca
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.12)

project(${TARGET_NAME})

set( CMAKE_VERBOSE_MAKEFILE on )
add_library(${TARGET_NAME} SHARED
${ALL_SRC}
)

if (MSVC)
target_compile_options(${TARGET_NAME} PRIVATE "/MP")
set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".pyd")
endif()

target_compile_features(${TARGET_NAME} PRIVATE cxx_std_17)

set_target_properties(${TARGET_NAME} PROPERTIES PREFIX "")

target_include_directories(${TARGET_NAME} PUBLIC
${ALL_INC_DIR}
)

target_link_directories(${TARGET_NAME} PUBLIC
${ALL_LIB_DIR}
)

if (DEFINED ALL_EXT_OBJ)
add_library(ext_obj OBJECT IMPORTED PRIVATE)

set_target_properties(ext_obj PROPERTIES
IMPORTED_OBJECTS ${ALL_EXT_OBJ}
)
target_link_libraries(${TARGET_NAME}
${ALL_LIB}
$<TARGET_OBJECTS:ext_obj>
${ALL_EXT_LINK}
)
else()
target_link_libraries(${TARGET_NAME}
${ALL_LIB}
${ALL_EXT_LINK}
)
endif()

target_compile_definitions(${TARGET_NAME} PUBLIC
${ALL_DEF}
)

0 comments on commit 60565ca

Please sign in to comment.