Skip to content

Commit f4baefc

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

26 files changed

+34
-37
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ project(${TARGET_NAME})
44

55
set(CMAKE_VERBOSE_MAKEFILE on)
66

7+
find_package(Python REQUIRED COMPONENTS Interpreter Development)
8+
79
add_library(${TARGET_NAME} SHARED ${ALL_SRC})
810

911
target_compile_options(${TARGET_NAME} PRIVATE ${ALL_COMP_ARGS})
@@ -14,7 +16,10 @@ target_compile_features(${TARGET_NAME} PRIVATE cxx_std_17)
1416

1517
set_target_properties(${TARGET_NAME} PROPERTIES PREFIX "")
1618

17-
target_include_directories(${TARGET_NAME} PUBLIC ${ALL_INC_DIR})
19+
target_include_directories(${TARGET_NAME} PUBLIC
20+
${ALL_INC_DIR}
21+
${Python_INCLUDE_DIRS}
22+
)
1823

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

@@ -29,3 +34,5 @@ target_link_libraries(${TARGET_NAME}
2934
)
3035

3136
target_compile_definitions(${TARGET_NAME} PUBLIC ${ALL_DEF})
37+
38+
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)