@@ -6,37 +6,23 @@ set(CMAKE_VERBOSE_MAKEFILE on)
66set (Python_FIND_VIRTUALENV FIRST)
77set (Python_FIND_STRATEGY LOCATION )
88
9- find_package (Python REQUIRED COMPONENTS Interpreter Development NumPy)
10-
119add_library (${TARGET_NAME} SHARED ${ALL_SRC} )
1210
1311foreach (FOLDER_NAME IN ITEMS layer0 layer1 layer2 layer3 layer4 layer5 ov)
1412 include (${CMAKE_CURRENT_SOURCE_DIR} /${FOLDER_NAME} /sources .cmake)
1513endforeach ()
1614
15+ list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
16+ include (Dependencies)
17+ include (Helpers)
18+
1719target_link_options (${TARGET_NAME} PRIVATE
1820 "$<$<PLATFORM_ID:Darwin>:LINKER:-undefined,dynamic_lookup>"
1921)
2022
2123target_compile_options (${TARGET_NAME} PRIVATE
2224 ${ALL_COMP_ARGS}
23-
24- $<$<NOT :$<CXX_COMPILER_ID:MSVC >>:
25- -Werror=return-type
26- -Wunused-variable
27- -Wno-switch
28- -Wno-narrowing
29- -Wno-char-subscripts
30- $<$<CONFIG:Debug>:-Og>
31- $<$<NOT :$<CONFIG:Debug>>:-O3>
32- >
33- $<$<CXX_COMPILER_ID:MSVC >:/MP>
34- $<$<CXX_COMPILER_ID:MSVC >:/std:c++17>
35- $<$<AND :$<CONFIG:Debug>,$<CXX_COMPILER_ID:MSVC >>:/Z7>
36-
37- # optimization currently causes a clang segfault on OS X 10.9 when
38- # compiling layer2/RepCylBond.cpp
39- $<$<PLATFORM_ID:Darwin>:-fno-strict-aliasing>
25+ ${PYMOL_COMPILE_OPTIONS}
4026)
4127
4228execute_process (
@@ -45,23 +31,6 @@ execute_process(
4531 OUTPUT_STRIP_TRAILING_WHITESPACE
4632)
4733
48- function (set_output_path lib path )
49- set_target_properties (${lib} PROPERTIES
50- PREFIX ""
51- SUFFIX "${PYTHON_MODULE_SUFFIX} "
52- OUTPUT_NAME "${lib} "
53- LIBRARY_OUTPUT_DIRECTORY "${path} "
54- RUNTIME_OUTPUT_DIRECTORY "${path} "
55- )
56-
57- foreach (CONFIG IN ITEMS RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
58- set_target_properties (${lib} PROPERTIES
59- LIBRARY_OUTPUT_DIRECTORY_${CONFIG} "${path} "
60- RUNTIME_OUTPUT_DIRECTORY_${CONFIG} "${path} "
61- )
62- endforeach ()
63- endfunction ()
64-
6534set_output_path(${TARGET_NAME} "${Python_SITEARCH} /pymol" )
6635
6736target_compile_features (${TARGET_NAME} PRIVATE cxx_std_17)
@@ -72,6 +41,7 @@ target_include_directories(${TARGET_NAME} PUBLIC
7241 ${ALL_INC_DIR}
7342 ${Python_INCLUDE_DIRS}
7443 ${Python_NumPy_INCLUDE_DIRS}
44+ ${PYMOL_INC_DIRS}
7545)
7646
7747target_link_directories (${TARGET_NAME} PUBLIC
@@ -81,22 +51,13 @@ target_link_directories(${TARGET_NAME} PUBLIC
8151target_link_libraries (${TARGET_NAME}
8252 ${ALL_LIB}
8353 ${ALL_EXT_LINK}
84- # pyconfig.py forces linking against pythonXY.lib on MSVC
85- $<$<CXX_COMPILER_ID:MSVC >:${Python_LIBRARIES} >
86- $<$<AND :$<CONFIG:Debug>,$<CXX_COMPILER_ID:MSVC >>:/DEBUG>
54+ ${PYMOL_LIBS}
8755)
8856
8957target_compile_definitions (${TARGET_NAME} PUBLIC
9058 ${ALL_DEF}
91- _PYMOL_LIBPNG
92- _PYMOL_FREETYPE
59+ ${PYMOL_DEF_MACROS}
9360 _PYMOL_NUMPY
94- $<$<CXX_COMPILER_ID:MSVC >:WIN32 >
95- $<$<PLATFORM_ID:Darwin>:PYMOL_CURVE_VALIDATE>
96-
97- # bounds checking in STL containers
98- # if DEBUG and not Windows compiler
99- $<$<AND :$<CONFIG:Debug>,$<NOT :$<CXX_COMPILER_ID:MSVC >>>:_GLIBCXX_ASSERTIONS>
10061)
10162
10263add_subdirectory (contrib/champ)
0 commit comments