Skip to content

Commit 5439ce4

Browse files
committed
Replace homegrown build options with standard
- tests -> BUILD_TESTING - fPIC -> CMAKE_POSITION_INDEPENDENT_CODE
1 parent 8274e94 commit 5439ce4

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ project(
66
HOMEPAGE_URL "http://astro-informatics.github.io/so3/"
77
LANGUAGES C)
88

9-
option(tests "Enable testing" ON)
109
option(conan_deps "Download ssht using conan" ON)
11-
if(NOT WIN32)
12-
option(fPIC "Enable position independent code" ON)
13-
endif()
1410
if(conan_deps AND download_ssht)
1511
message(
1612
FATAL_ERROR "conan_deps and download_ssht options are mutually exclusive.")
@@ -20,9 +16,7 @@ if(NOT CMAKE_BUILD_TYPE)
2016
set(CMAKE_BUILD_TYPE "Debug")
2117
endif()
2218

23-
if(tests)
24-
enable_testing()
25-
endif()
19+
include(CTest)
2620
if(conan_deps OR CONAN_EDITABLE_MODE)
2721
include("${PROJECT_SOURCE_DIR}/cmake/conan_dependencies.cmake")
2822
endif()
@@ -41,7 +35,7 @@ find_package(FFTW3 REQUIRED)
4135
find_library(MATH_LIBRARY m)
4236

4337
add_subdirectory(src/c)
44-
if(tests)
38+
if(BUILD_TESTING)
4539
include("${PROJECT_SOURCE_DIR}/cmake/fetch_cmocka.cmake")
4640
add_subdirectory(tests)
4741
endif()

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from skbuild import setup
22

3-
cmake_args = ["-Dtests:BOOL=OFF", "-Dconan_deps=ON", "-DfPIC=ON"]
3+
cmake_args = [
4+
"-DBUILD_TESTING:BOOL=OFF",
5+
"-Dconan_deps=ON",
6+
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON",
7+
]
48

59
setup(
610
name="so3",

src/c/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ target_compile_features(so3 PUBLIC c_std_99)
1111
configure_file(${PROJECT_SOURCE_DIR}/include/so3/so3_version.in.h
1212
${PROJECT_BINARY_DIR}/include/so3/so3_version.h)
1313

14-
if(fPIC)
15-
set_target_properties(so3 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
16-
endif()
17-
1814
if(NOT SKBUILD)
1915
install(
2016
TARGETS so3

0 commit comments

Comments
 (0)