Skip to content

Commit 0034c11

Browse files
authored
Fix cmake install target on windows (#315)
* Fix cmake install target on windows Install the dll to the bin directory, instead of a non-existent CMAKE_INSTALL_RUNTIMEDIR. * Combine install targets The only difference was the `RUNTIME DESTINATION` for windows. Since that is set to the default path, they can use the same definition.
1 parent dd6b2ed commit 0034c11

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

src/CMakeLists.txt

+7-17
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,11 @@ target_link_libraries(nlohmann_json_schema_validator PUBLIC
5454

5555
if (JSON_VALIDATOR_INSTALL)
5656
# Normal installation target to system. When using scikit-build check python subdirectory
57-
if (WIN32)
58-
# TODO: Probably wrong, please fix
59-
install(TARGETS nlohmann_json_schema_validator
60-
EXPORT nlohmann_json_schema_validatorTargets
61-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT nlohmann_json_schema_validator_Runtime
62-
NAMELINK_COMPONENT nlohmann_json_schema_validator_Development
63-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT nlohmann_json_schema_validator_Development
64-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nlohmann COMPONENT nlohmann_json_schema_validator_Development
65-
RUNTIME DESTINATION ${CMAKE_INSTALL_RUNTIMEDIR} COMPONENT nlohmann_json_schema_validator_Runtime)
66-
else ()
67-
install(TARGETS nlohmann_json_schema_validator
68-
EXPORT nlohmann_json_schema_validatorTargets
69-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT nlohmann_json_schema_validator_Runtime
70-
NAMELINK_COMPONENT nlohmann_json_schema_validator_Development
71-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT nlohmann_json_schema_validator_Development
72-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nlohmann COMPONENT nlohmann_json_schema_validator_Development)
73-
endif ()
57+
install(TARGETS nlohmann_json_schema_validator
58+
EXPORT nlohmann_json_schema_validatorTargets
59+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT nlohmann_json_schema_validator_Runtime
60+
NAMELINK_COMPONENT nlohmann_json_schema_validator_Development
61+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT nlohmann_json_schema_validator_Development
62+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nlohmann COMPONENT nlohmann_json_schema_validator_Development
63+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT nlohmann_json_schema_validator_Runtime)
7464
endif ()

0 commit comments

Comments
 (0)