Skip to content

Commit 9d9656b

Browse files
committed
moving champ build process to a separate CMakeLists.txt file
1 parent 9680979 commit 9d9656b

26 files changed

+28
-36
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ target_link_libraries(${TARGET_NAME}
2929
)
3030

3131
target_compile_definitions(${TARGET_NAME} PUBLIC ${ALL_DEF})
32+
33+
add_subdirectory(contrib/champ)

contrib/champ/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
set(CHEMPY_PROJECT_NAME chempy.champ._champ)
4+
set(CMAKE_VERBOSE_MAKEFILE on)
5+
6+
project(${CHEMPY_PROJECT_NAME} LANGUAGES C)
7+
8+
find_package(Python REQUIRED COMPONENTS Interpreter Development)
9+
10+
file(GLOB_RECURSE SOURCES "src/*.c")
11+
add_library(${CHEMPY_PROJECT_NAME} MODULE ${SOURCES})
12+
13+
target_include_directories(${CHEMPY_PROJECT_NAME} PUBLIC
14+
${Python_INCLUDE_DIRS}
15+
include
16+
)
17+
set_target_properties(${CHEMPY_PROJECT_NAME} PROPERTIES
18+
PREFIX ""
19+
SUFFIX "${Python_MODULE_EXTENSION}"
20+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CHEMPY_PROJECT_NAME}"
21+
)
22+
target_compile_features(${CHEMPY_PROJECT_NAME} PRIVATE cxx_std_17)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)