Skip to content

Commit 9b65562

Browse files
Change shared library install directory for windows
On Windows DLL -> "bin", import library (.lib) -> "lib"
1 parent 1df1e04 commit 9b65562

6 files changed

Lines changed: 29 additions & 14 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ add_custom_target(html)
5151
if(CMAKE_HOST_UNIX)
5252
#easy on Unix - just follow the GNU standard
5353
include(GNUInstallDirs)
54-
set(STATIC_LIBRARY_SUFFIX "")
54+
set(STATIC_LIBRARY_SUFFIX "")
55+
set(NEXUS_INSTALL_SHLIB ${CMAKE_INSTALL_LIBDIR})
5556
else()
5657
set(CMAKE_INSTALL_LIBDIR lib)
5758
set(CMAKE_INSTALL_DOCDIR doc)
5859
set(CMAKE_INSTALL_INCLUDEDIR include)
5960
set(CMAKE_INSTALL_MANDIR man)
6061
set(CMAKE_INSTALL_BINDIR bin)
61-
set(STATIC_LIBRARY_SUFFIX "Static")
62+
set(STATIC_LIBRARY_SUFFIX "Static")
63+
set(NEXUS_INSTALL_SHLIB ${CMAKE_INSTALL_BINDIR})
6264
endif()
6365

6466

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ These instructions will build everything except the applications using LIBXML2 (
150150

151151
- Provide source and build paths in the relevant boxes
152152
- Click on Configure, choose appropriate visual studio version when prompted
153-
- A list of options will appear, choose the appropriate ENABLE_ ones and press Configure again
154-
- If nothing is red, click on Generate
153+
- A list of options will appear, choose the appropriate ENABLE_ ones
154+
- Also check the CMAKE_INSTALL_PREFIX is appropriate, this is the root where file may be installed to later
155+
- press Configure again
156+
- If anything now appears in red, it means it is a newly displayed option. If you change ones of these (or any other value) you need to pres Configure again, otherwise move onto the next step
157+
- Click on Generate
155158

156159
* Browse to the build directory and open the generated NeXus.sln
157160
* Build the solution
161+
162+
- If you wish to copy files to the install directory above, right click and Build the INSTALL project

bindings/cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ set_target_properties(NeXus_CPP_Shared_Library PROPERTIES
5252
SOVERSION ${ABI_CURRENT})
5353

5454
install (TARGETS NeXus_CPP_Shared_Library
55-
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
55+
RUNTIME DESTINATION ${NEXUS_INSTALL_SHLIB} COMPONENT Runtime
5656
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
5757

5858
install (TARGETS NeXus_CPP_Static_Library

bindings/f77/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ set (SOURCES napif.f)
3636
add_library (NeXus_F77_Static_Library STATIC ${HEADERS} ${SOURCES})
3737

3838
set_target_properties(NeXus_F77_Static_Library PROPERTIES
39-
OUTPUT_NAME NeXus77)
39+
OUTPUT_NAME NeXus77${STATIC_LIBRARY_SUFFIX})
4040

4141
target_link_libraries(NeXus_F77_Static_Library NeXus_Static_Library)
4242

@@ -52,9 +52,13 @@ set_target_properties(NeXus_F77_Shared_Library PROPERTIES
5252

5353
target_link_libraries(NeXus_F77_Shared_Library NeXus_Shared_Library)
5454

55-
install (TARGETS NeXus_F77_Static_Library NeXus_F77_Shared_Library
56-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
57-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/nexus COMPONENT Development)
55+
install (TARGETS NeXus_F77_Shared_Library
56+
RUNTIME DESTINATION ${NEXUS_INSTALL_SHLIB} COMPONENT Runtime
57+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
58+
59+
install (TARGETS NeXus_F77_Static_Library
60+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/nexus
61+
COMPONENT Development)
5862

5963
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/napif.inc
6064
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nexus

bindings/f90/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ set (SOURCES NXmodule.f90 NXUmodule.f90)
3434
#------------------------------------------------------------------------------
3535

3636
add_library (NeXus_F90_Static_Library STATIC ${SOURCES})
37-
set_target_properties(NeXus_F90_Static_Library PROPERTIES OUTPUT_NAME NeXus90)
37+
set_target_properties(NeXus_F90_Static_Library PROPERTIES OUTPUT_NAME NeXus90${STATIC_LIBRARY_SUFFIX})
3838
target_link_libraries(NeXus_F90_Static_Library NeXus_Static_Library)
3939

4040
#------------------------------------------------------------------------------
@@ -51,6 +51,10 @@ set_target_properties(NeXus_F90_Shared_Library PROPERTIES
5151

5252
target_link_libraries(NeXus_F90_Shared_Library NeXus_Shared_Library )
5353

54-
install (TARGETS NeXus_F90_Static_Library NeXus_F90_Shared_Library
55-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
56-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/nexus COMPONENT Development)
54+
install (TARGETS NeXus_F90_Shared_Library
55+
RUNTIME DESTINATION ${NEXUS_INSTALL_SHLIB} COMPONENT Runtime
56+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
57+
58+
install (TARGETS NeXus_F90_Static_Library
59+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/nexus
60+
COMPONENT Development)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ target_link_libraries(NeXus_Shared_Library ${NAPI_LINK_LIBS})
101101
# install the targets
102102
#-----------------------------------------------------------------------------
103103
install (TARGETS NeXus_Shared_Library
104-
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime
104+
RUNTIME DESTINATION ${NEXUS_INSTALL_SHLIB} COMPONENT Runtime
105105
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
106106

107107
install (TARGETS NeXus_Static_Library

0 commit comments

Comments
 (0)